// ml:run = $bin < input
// ml:opt = 0
// ml:ccf += -g
#include <iostream>
#include <algorithm>
#include <vector>

struct edge
{
    int from, to, id;
};

int const maxn = 200007;
int const maxm = 400007;
int father[maxn];
int vis[maxn];
bool cons[maxn];
bool cont[maxn];
bool disable[maxm];
int n, m;
int s, t, ds, dt;
bool con;

std::vector<edge> edges;

int get_father(int x)
{
    return x == father[x] ? x : (father[x] = get_father(father[x]));
}

void set_union(int u, int v)
{
    int tu = get_father(u);
    int tv = get_father(v);
    if (tu != tv) father[tu] = tv;
}

int main()
{
    std::ios_base::sync_with_stdio(false);
    std::cin >> n >> m;
    edges.resize(m);
    for (int i = 1; i <= n; i++) father[i] = i;
    for (int i = 0; i < m; i++) {
        std::cin >> edges[i].from >> edges[i].to;
        edges[i].id = i;
    }
    std::cin >> s >> t >> ds >> dt;
    for (int i = 0; i < m; i++) {
        if (edges[i].to == s) std::swap(edges[i].from, edges[i].to);
        if (edges[i].from == t) std::swap(edges[i].from, edges[i].to);
    }
    int p = -1;
    for (int i = 0; i < m; i++) {
        if (edges[i].from != s && edges[i].to != t)
            set_union(edges[i].from, edges[i].to);
        if (edges[i].from == s && edges[i].to == t) {
            p = i;
            disable[i] = true;
        }
    }

    /* for (int i = 1; i <= n; i++) father[i] = get_father(father[i]); */

    for (int i = 0; i < m; i++) {
        if (edges[i].from == s && edges[i].to == t) continue;
        if (edges[i].from == s) {
            cons[get_father(edges[i].to)] = true;
        }
        if (edges[i].to == t) {
            cont[get_father(edges[i].from)] = true;
        }
    }
    bool ok = true;
    int count = 0;
    for (int i = 0; i < m; i++) {
        if (edges[i].from == s && edges[i].to == t) continue;
        if (edges[i].from == s) {
            int t = get_father(edges[i].to);
            if (vis[t]) { disable[i] = true; continue; }
            if (cons[t] && !cont[t]) {
                ds--;
                vis[t] = 3;
                if (ds < 0) { ok = false; break; }
            }
        }
        if (edges[i].to == t) {
            int t = get_father(edges[i].from);
            if (vis[t]) { disable[i] = true; continue; }
            if (cont[t] && !cons[t]) {
                dt--;
                vis[t] = 3;
                if (dt < 0) { ok = false; break; }
            }
        }
    }

    for (int i = 0; i < m; i++) {
        if (edges[i].from == s && edges[i].to == t) continue;
        if (edges[i].from == s) {
            int t = get_father(edges[i].to);
            if (cons[t] && cont[t]) {
                count++;
                if (vis[t]) {
                    if (vis[t] == 1) vis[t] = 3;
                    else disable[i] = true;
                } else if (!con) {
                    vis[t] = 2;
                    con = true;
                    ds--;
                    dt--;
                } else {
                    if (ds) { vis[t] = 3; ds--; }
                    else disable[i] = true;
                }
            }
        }
        if (edges[i].to == t) {
            int t = get_father(edges[i].from);
            if (cont[t] && cons[t]) {
                count++;
                if (vis[t]) {
                    if (vis[t] == 2) vis[t] = 3;
                    else disable[i] = true;
                } else if (!con) {
                    vis[t] = 1;
                    con = true;
                    ds--;
                    dt--;
                } else {
                    if (dt) { vis[t] = 3; dt--; }
                    else disable[i] = true;
                }
            }
        }

        /* std::cerr << edges[i].from << " " << edges[i].to << "    " << ds << " " << dt << "\n"; */

        if (ds < 0 || dt < 0) {
            ok = false;
            break;
        }
    }

    /* std::cerr << ok << "\n"; */

    if (!count) {
        disable[p] = false;
        ds--; dt--;
        if (ds < 0 || dt < 0) ok = false;
    }

    /* std::cerr << ok << "\n"; */

    for (int i = 0; i < m; i++) {
        if (edges[i].from != s) {
            int t = get_father(edges[i].from);
            if (vis[t] != 3) { ok = false; break; }
        }
        if (edges[i].to != t) {
            int t = get_father(edges[i].to);
            if (vis[t] != 3) { ok = false; break; }
        }
    }

    /* std::cerr << ok << "\n"; */

    if (!ok) {
        std::cout << "No\n"; return 0;
    }
    std::cout << "Yes\n";
    for (int i = 1; i <= n; i++) father[i] = i;
    for (int i = 0; i < m; i++) {
        if (disable[i]) continue;
        int u = edges[i].from, v = edges[i].to;
        if (get_father(u) == get_father(v)) continue;
        std::cout << u << " " << v << "\n";
        set_union(u, v);
    }
}

